<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>

<jsp:include page="header.jsp"></jsp:include>
	<body>
		<div id="main-content">
			<h2>
				欢迎 ${sessionScope.user.username}
			</h2>

			<div class="clear"></div>

			<div class="content-box">

				<div class="content-box-header">
					<h3>
						增加管理员
					</h3>

					<div class="clear"></div>
				</div>
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">

						<form action="admin_add" method="post" id="myform">
							<input type="hidden" name="submitFlag" > 
							<fieldset>
								<p>
									<label>
										用户名
									</label>
									<input class="text-input small-input" type="text" id="username"
										name="username" />
									<span id="u_msg" class="input-notification attention png_bg"></span>
								</p>
								<p>
									<label>
										密码
									</label>
									<input class="text-input small-input" type="password"
										id="password" name="password" />
									<span id="p_msg" class="input-notification attention png_bg"></span>
								</p>
								<p>
									<label>
										确认密码
									</label>
									<input class="text-input small-input" type="text"
										id="repassword" name="repassword" />
									<span id="r_msg" class="input-notification attention png_bg"></span>
								</p>
								</p>

								<p>
									<input class="button" type="button" id="dosubmit" value="增加" />
								</p>
							</fieldset>
							<div class="clear"></div>
						</form>

					</div>

				</div>
			</div>

			<div id="footer">
				<small> &#169; Copyright 2011 黄淮学院 | 信息工程学校 | <a href="#">Top</a>
				</small>
			</div>
		</div>
		<script type="text/javascript">
$(document).ready(function() {

	$("#dosubmit").click(function() {
		var u = $("#username").val();
		var pw = $("#password").val();
		var repw = $("#repassword").val();

		if (u == "") {
			$("#u_msg").show();
			$("#u_msg").html("请输入用户名！");
		} else {
			if (pw == "" || repw == "") {
				$("#u_msg").hide();
				$("#p_msg").show();
				$("#p_msg").html("请输入密码和确认密码！");
			} else {
				$("#u_msg").hide();
				$("#p_msg").hide();
				if (pw == repw) {
					$("#myform").submit()
				} else {
					$("#r_msg").show();
					$("#r_msg").html("两次密码不一致");
				}
			}
		}
	})

})
</script>
	</body>
</html>
